﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Dropable</title>
    <link href="css/ui.all.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #draggable, #draggable-novalid
        { 
            width:75px;
            height:75px;
            border:solid 1px #000;
            margin:13px;
            padding:3px;
            color:Black;
            font-weight:bold;
            background-color:Green;
            float:left;
        }
        
        #draggable-novalid
        {
            background-color:Red;
        }
        
        #droppable 
        { 
            width:132px;
            height:132px;
            border:solid 1px #000;
            margin:13px;
            padding:3px;
            color:Black;
            font-weight:bold;
            background-color:Yellow;
        }
    </style>
    
    <!-- Script -->
    <script src="script/jquery-1.3.2.js" type="text/javascript"></script>
    <script src="script/ui.core.js" type="text/javascript"></script>
    <script src="script/ui.draggable.js" type="text/javascript"></script>
    <script src="script/ui.droppable.js" type="text/javascript"></script>
    
     <!-- Script memilih elemen untuk diberikan kemampuan drag -->
    <script language="javascript" type="text/javascript">
        $(document).ready(function() {
        $("#draggable, #draggable-novalid").draggable();
            $("#droppable").droppable({
                accept: '#draggable',
                drop: function() {
                    $(this).find('p').html('Dropped!');
                }
            });
        });
    </script>
</head>
<body>
    
    <div id="draggable">
        <p>valid</p>
    </div>
    
    <div id="draggable-novalid">
        <p>no valid</p>
    </div>
    
    <div id="droppable">
        <p>Drop something to me</p>
    </div>

</body>
</html>
